<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@include file="/page/common/public.jspf"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="pragma" content="no-cache"> 
<meta http-equiv="cache-control" content="no-cache"> 
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css" href="${skin }/v1.min.css?v=${v}" />
<link rel="stylesheet" type="text/css"
	href="${skin }/investment_view_web2.css?v=${v}" />
<link rel="stylesheet" type="text/css"
	href="${skin }/header_footer.css?v=${v}" />
<link href="${skin }/investment_view_web2.css?v=${v}" type="text/css"
	rel="stylesheet" />
<script type="text/javascript"
	src="${path }/js/common/jquery1.10.2.min.js"></script>
<script src="${path }/js/common/helper.js?v=${v}"></script>
<script src="${path }/js/common/cookie.js?v=${v}"></script>
<script src="${path }/js/invest/invest.js?v=${v}"></script>
<script src="${path }/js/timeCountDown.js?v=${v}"></script>
<script type="text/javascript" src="${path }/js/v1.min.js"></script>
<title>项目详情-${borrowInfo.borrowName }</title>
</head>

<body>
	<input type="hidden" id="bidStopyear"
		value="<fmt:formatDate value="${borrowInfo.bidStopTime}" type="both" pattern="yyyy"/>" />
	<input type="hidden" id="bidStopmonth"
		value="<fmt:formatDate value="${borrowInfo.bidStopTime}" type="both" pattern="MM"/>" />
	<input type="hidden" id="bidStopday"
		value="<fmt:formatDate value="${borrowInfo.bidStopTime}" type="both" pattern="dd"/>" />
	<input type="hidden" id="bidStophour"
		value="<fmt:formatDate value="${borrowInfo.bidStopTime}" type="both" pattern="HH"/>" />
	<input type="hidden" id="bidStopmin"
		value="<fmt:formatDate value="${borrowInfo.bidStopTime}" type="both" pattern="mm"/>" />
	<input type="hidden" id="bidStopss"
		value="<fmt:formatDate value="${borrowInfo.bidStopTime}" type="both" pattern="ss"/>" />
	<c:import url="../include/top.jsp">
		<c:param name="type" value="wytz"></c:param>
	</c:import>

	<!--面包屑导航开始-->
	<section>
		<div class="fix_width">
			<div class="m-nav">
				<a href="/">首页</a> <i></i> <label><a href="${path }/borrowInfo/list.htm">投资列表</a></label>
				<i></i> <label>${borrowInfo.borrowName }</label>
			</div>
		</div>
	</section>
	<!--面包屑导航结束-->


	<!-- 红包弹出   -->
	<link rel="stylesheet" type="text/css" href="${skin }/layer.css" />
	<div class="mask" id="hb_pan" style="display: none">
		<div style="z-index: 19891016; width: 850px; height: 550px;"
			id="xubox_layer1" class="xubox_layer" type="page">
			<div style="background-color: #fff; z-index: 19891015;"
				class="xubox_main">
				<div class="xubox_page" style="top: 36px;">
					<div id="SelectRedPackage" class="layer_pageContent">

						<style>
.ui-content {
	padding: 20px 0px;
	overflow: hidden;
}

.ui-content .fl {
	border-left: 1px solid #e3e3e3;
	padding-left: 34px;
	margin-left: -1px;
	width: 700px;
}

.ui-content .fl h2 {
	font-size: 16px;
	color: #888;
	margin: 5px 0 15px;
	padding: 0 0 0px 0;
}

.ui-content .content-up {
	width: 700px;
	border-bottom: 1px solid #e5e5e5;
	padding: 0 0 8px 0;
	margin: 0 43px 8px 0;
}

.ui-content span {
	width: 220px;
	display: inline-block;
}

.ui-content .content-up span {
	color: #888;
}

.ui-content .content-down span {
	font-size: 14px;
}

.out_tr_bg{background-color: #f6f6f6; height:40px;line-height:40px;text-align: center;font-size:16px;font-weight: 700;border-bottom: 1px solid #ddd;}
.tr_out_listbg{background-color: #f6f6f6; height:42px;line-height:42px;text-align: center;font-size: 16px;}
.tr_out_listbg td{text-align: center;border-bottom: 1px dotted #e8e8e8;background: #fff;padding-top: 6px;}
.tr_out_listbg input{font-size:20px;padding: 6px;width: 20px;height: 20px;display:inline-block;}

</style>
						<div class="xf_mem_Account xf_mem_shzdjkb_box"
							style="height: 400px; overflow-y: scroll; width: 100%;">

							<table border="0" style="width: 100%;">
								<thead>
									<tr class="out_tr_bg">
										<th></th>
										<th>面值</th>
										<th>类型</th>
										<th>获取日期</th>
										<th>过期日期</th>
										<th>使用条件</th>
									</tr>
								</thead>
								<tbody id="tbody">

								</tbody>
							</table>

						</div>
					</div>
				</div>
				<div class="xubox_title" style="cursor: move;" move="ok">
					<em>请点击选择要使用的红包</em>
				</div>
				<span class="xubox_setwin"><a
					class="xubox_close xulayer_png32 xubox_close0 close_bt"
					href="javascript:;" style=""></a></span><span class="xubox_botton"></span>
			</div>
			<div id="xubox_border1" class="xubox_border"
				style="z-index: 19891014; opacity: 0.3; top: -6px; left: -6px; width: 862px; height: 562px; background-color: rgb(0, 0, 0);"></div>
		</div>

	</div>
	<div class="wrap">
		<div class="box">
			<section>
				<div class="touzi_top clearfix">
					<div class="tztop_left fl">
						<div class="title_box">
							<h1 class="pr30">
								<span><em>${borrowInfo.borrowName }</em></span><span class="w1"></span>
							</h1>
						</div>
						<div class="tz_lilv fl">
							<dl class="clearfix">
								<dt>年化收益率：</dt>
								<dd class="f14">
									<span>${borrowInfo.borrowRate}%</span>
								</dd>
							</dl>
							<dl class="clearfix">
								<dt>收益方式：</dt>
								<dd class="f14">
									<span> ${borrowInfo.repaymentType.text } </span>
								</dd>
							</dl>
							<dl class="clearfix">
								<dt>保障方式：</dt>
								<dd>
									<span class="f14">本息全额担保</span>
								</dd>
							</dl>
						</div>
						<div class="tz_jine fl">
							<dl class="clearfix">
								<dt>可投金额：</dt>
								<dd>
									<em class="f20 yellwo"><fmt:formatNumber
											value="${borrowInfo.borrowMoney/100-borrowInfo.raiseMoney/100}"
											pattern="#0"></fmt:formatNumber> </em>&nbsp;<span class="f16">元</span>
								</dd>
							</dl>

							<div class="ketou">
								投资总额：
								<fmt:formatNumber value="${borrowInfo.borrowMoney/100/10000}"
									pattern="#0.0"></fmt:formatNumber>
								万元 / 已投：<fmt:formatNumber value="${borrowInfo.raiseMoney/100}" pattern="#0"></fmt:formatNumber>元 / <fmt:formatNumber value="${borrowInfo.minInvest / 100}" pattern="#0"></fmt:formatNumber>元起投
								<i class="ico_progress"> <i class="ico_bace"></i> <i
									class="ico_yitou"
									style="width: <fmt:formatNumber type="number" value="${(borrowInfo.raiseMoney / borrowInfo.borrowMoney) * 100}" maxFractionDigits="1"/>%"></i>
								</i>
							</div>

							<dl class="clearfix">
								<dt>剩余时间：</dt>
								<dd>
									<span class="f14 countdown_row countdown_amount hasCountdown"
										id="leftTime"> <c:choose>
											<c:when test="${borrowInfo.status eq 'RAISE' }">
												<span class="countdown_row countdown_amount"
													id="countdown_row"></span>
											</c:when>
											<c:otherwise>
												<span class="countdown_row countdown_amount">该标已结束</span>
											</c:otherwise>
										</c:choose>
									</span>
								</dd>
							</dl>
						</div>
					</div>

					<form id="computeForm" action="/deal/bid/56853" method="post"
						data-login="1">
						<div class="tztop_right fr" style="height:290px">
						<c:choose>
						<c:when test="${not empty usersession }">
							<h2>
								<span class="text f14">可用余额：</span>
								<span class="f18 color-yellow1">
									<fmt:formatNumber value="${account.baseMoney/100 - account.freezeMoney/100}" type="currency" pattern="0.00" />
									</span><span class="yellwo">元</span>
								<span class="f14"><a
									href="${path }/memberCenter/toImprest.htm">充值</a></span>
							</h2>
							</c:when>
							<c:otherwise>
							<h2>
								<span class="text f14">可用余额:</span>
								<span class="f14"><a
									href="${path }/page/login/login.jsp" target="_blank">登录</a>后可见</span>
							</h2>
							</c:otherwise>
							</c:choose>
							<p class="text">
								投资金额： <input type="text" class="text_box" name="investMoney"
									id="investMoney" maxlength="10"
									placeholder='<fmt:formatNumber value="${borrowInfo.minInvest / 100}" type="currency" pattern="0" />元起投' />
								&nbsp;&nbsp;元
							</p>
							<p class="text red f14" style="padding: 8px 7px;">投资增量金额为<fmt:formatNumber value="${borrowInfo.incMoney/100 }" type="currency" pattern="0" />的整倍数</p>
							<p class="text" style="padding-top:2px;">
								<a class="xf_con_inputfbjk" href="javascript:;"
									id="xf_con_inputfbjk">使用红包</a>
									<input type="hidden" id="chooseid" value=""/>
									 <input type="text"
									style="width: 82px; padding:3px; margin-left: 6px;" class="text_box" id="redmoney"
									maxlength="6" value="" readonly="readonly" /> &nbsp;&nbsp;元
							</p>

							<p>
								<c:choose>
									<c:when test="${borrowInfo.status eq 'RAISE'}">
										<button type="button" name="investBtn" id="investBtn"
											value="确定投资" class="button_touzi">投资</button>
									</c:when>
									<c:when
										test="${auto.status eq 'RAISE' && (borrowInfo.raiseMoney / auto.borrowMoney) == 1}">
										<span class="button_touzi but-disabled">满标</span>
									</c:when>
									<c:when
										test="${auto.status ne 'RAISE' && (borrowInfo.raiseMoney / auto.borrowMoney) == 1}">
										<span class="button_touzi but-disabled">已结束</span>
									</c:when>
									<c:otherwise>
										<span class="button_touzi but-disabled">已结束</span>
									</c:otherwise>
								</c:choose>
								<input type="hidden" name="borrowInfoId" id="borrowInfoId"
									value="${borrowInfo.id}" />
							</p>
							<span class="fceng color-red1 none" id="invest_tip"></span>
						</div>

					</form>

				</div>
			</section>
			<section>
				<div class="main clearfix">
					<div class="box_title">
						<i class="danbao"></i>担保方介绍
					</div>
					<div class="con_width">
						<h2>
							<i class="ico_jianjie"></i>机构简介
						</h2>
						${borrowInfo.guaranteeDesc}
					</div>
				</div>
			</section>
			<section>
				<div class="main clearfix">
					<div class="box_title">
						<i class="ico_jiedai"></i>融资方信息
					</div>
					<div class="con_width">
						<h2>
							<i class="ico_jiben"></i>基本信息
						</h2>
						<div class="border_b pb10">
							<table width="100%" border="0" cellpadding="0" cellspacing="0"
								class="tab_jiben tab_jiben1">
								<colgroup>
									<col width="108">
								</colgroup>
								<tbody>
									<tr>
										<th>简介：</th>
										<td>
											<p style="text-align: center;">
												<span style="line-height: 0px;">﻿</span> <img
													src="${path }/images/info_ewm.jpg"
													style="text-align: center;" />
											</p>
											<p>
												<strong>产品介绍</strong>
											</p>
											${borrowInfo.productDesc }
											<p>
												<strong>投资安全性</strong><br />
											</p>
											${borrowInfo.dangerDesc }
											<p>
												<strong>融资方介绍</strong>
											</p>
											${borrowInfo.borrowerDesc }
											<!--!doctype-->
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</section>


			<section>
				<div class="shadow clearfix pb20">
					<div class="box_title">
						<i class="ico_huankuan"></i>投资记录
					</div>
					<div class="con_width">
						<table class="con_hk f14" width="100%">
							<colgroup>
								<col width="314">
								<col width="344">
								<col width="282">
							</colgroup>
							<thead class="">
								<tr class="text1">
									<td>
										<h4>
											<span>目前投资总额（元）</span>
										</h4> <span class="color-yellow1 f20"><fmt:formatNumber value="${borrowInfo.raiseMoney / 100}" pattern="0.00"/></span>
									</td>
									<td>
										<h4>剩余投资总额（元）</h4> <span class="color-yellow1 f20"><fmt:formatNumber value="${borrowInfo.borrowMoney / 100 - borrowInfo.raiseMoney / 100}" pattern="0.00"/> </span>
									</td>
									<td>
										<h4>投资结束时间</h4> <span class="color-black"> <fmt:formatDate
												value="${borrowInfo.bidStopTime}" type="both"
												pattern="yyyy年MM月dd日 HH时mm分ss秒" />
									</span>
									</td>
								</tr>
							</thead>
							<tbody>
								<tr class="text1">
									<td class="border_b"><span>投资人</span></td>
									<td class="border_b">投资金额（元）</td>
									<td class="border_b">投资时间</td>
									<td class="border_b"></td>
								</tr>
								<c:forEach items="${investList}" var="invest"
									varStatus="vstatus">
									<c:choose>
										<c:when test="${vstatus.index%2 == 0}">
											<tr class="f16">
											<c:set var="cardNumber" value="${fn:substring(invest.cardNumber,16,17) }" />
												<td><span> 
												<c:choose>
															<c:when test="${empty invest.mobile}">***</c:when>
															<c:when test="${fn:length(invest.mobile) > 10}">
																<c:out
																	value="${fn:substring(invest.mobile, 0, 2)}**" />
																	<c:out value="${fn:substring(invest.mobile, 9, 11)}"/>
															</c:when>
															<c:otherwise>
																<c:out value="${invest.mobile}***" />
															</c:otherwise>
														</c:choose>
												<c:choose>
															<c:when test="${empty invest.realName}">***</c:when>
															<c:otherwise>
																<c:out value="（${fn:substring(invest.realName, 0, 1)}" />
																<c:choose>
																<c:when test="${fn:substring(invest.cardNumber,16,17)%2 eq 0}"><c:out value="女士）"/></c:when>
																<c:otherwise><c:out value="先生）"/></c:otherwise>
																</c:choose>
															</c:otherwise>
														</c:choose></span></td>
												<td><span class="color-yellow1">¥${invest.investMoney / 100}</span></td>
												<td><fmt:formatDate value="${invest.investTime}"
														type="both" pattern="yyyy/MM/dd HH:mm" /></td>
												<td></td>
											</tr>
										</c:when>
										<c:otherwise>
											<tr class="trbg f16">
												<td><span>
												<c:choose>
															<c:when test="${empty invest.mobile}">***</c:when>
															<c:when test="${fn:length(invest.mobile) > 10}">
																<c:out
																	value="${fn:substring(invest.mobile, 0, 2)}**" />
																	<c:out value="${fn:substring(invest.mobile, 9, 11)}"/>
															</c:when>
															<c:otherwise>
																<c:out value="${invest.mobile}***" />
															</c:otherwise>
														</c:choose>
												 <c:choose>
															<c:when test="${empty invest.realName}">***</c:when>
															<c:otherwise>
																<c:out value="（${fn:substring(invest.realName, 0, 1)}" />
																<c:choose>
																<c:when test="${fn:substring(invest.cardNumber,16,17)%2 eq 0}"><c:out value="女士）"/></c:when>
																<c:otherwise><c:out value="先生）"/></c:otherwise>
																</c:choose>
															</c:otherwise>
														</c:choose></span></td>
												<td><span class="color-yellow1">¥${invest.investMoney / 100}</span></td>
												<td><fmt:formatDate value="${invest.investTime}"
														type="both" pattern="yyyy/MM/dd HH:mm" /></td>
												<td></td>
											</tr>
										</c:otherwise>
									</c:choose>
								</c:forEach>
							</tbody>
						</table>
					</div>
				</div>
			</section>
		</div>
	</div>

	<c:import url="../include/foot.jsp"></c:import>
<script type="text/javascript">
	$(document).ready(function() {
		//点击使用红包
		$("#xf_con_inputfbjk").click(function() {
			var isLogin = ${isLogin};
			if(!isLogin){
				window.location.href="/page/login/login.jsp";
			}
			var money = $.trim($("#investMoney").val());
			if (money == null || money == "") {
				alert("请输入投资金额");
				return;
			}
            $.ajax({
                url: '/redpacket/getRedpacket.htm',
                type: 'GET',
                success: function(data) {
                	$("#tbody").html(data);
    				$('.mask,#hb_pan').show(100);
                },
                error: function() {}
            })
		});
	});
	
	$('.close_bt').click(function() {
		$('.mask,#hb_pan').hide(100);
	});
	
	$(document).on('click','.redid',function(event){
		$("#chooseid").attr("value",$(this).val());
		$("#redmoney").attr("value",$(this).data('money'));
		$('.mask,#hb_pan').hide(100);
	});
</script>
</body>
</html>
